// Author: wsfuyibing <682805@qq.com>
// Date: 2025-04-28

package kind

import "fmt"

// Mobile
// 手机号.
type Mobile string

const MobileUndefined Mobile = ""

func (o Mobile) IsSpecified() bool   { return o != MobileUndefined }
func (o Mobile) IsUnspecified() bool { return o == MobileUndefined }

func (o Mobile) Mask() (str string) {
    if s := o.String(); len(s) > 4 {
        str = fmt.Sprintf(`%s****%s`, o[:3], o[len(o)-4:])
    }
    return
}

func (o Mobile) String() string {
    return string(o)
}
